package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.vo.ReservationVo;
import com.zzyl.vo.TimeCountVo;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface CustomerReservationMapper {

    Page<ReservationVo> selectByPage(Integer status);

    /**
     * 新增预约
     * @param reservationVo
     */
    void add(ReservationVo reservationVo);

    /**
     * 取消预约（更新）
     * @param id
     */
    void cancelAppointment(Long id);

    /**
     * 查询取消预约次数
     * @return {@link Integer }
     */
    Integer cancelCount(Long userId,LocalDateTime start);

    /**
     * 查询符合时间段的对象
     * @param startTime
     * @param endTime
     * @return {@link List }<{@link ReservationVo }>
     */


    /**
     * 查询剩余次数
     * @param time
     * @return {@link Integer }
     */
    Integer getCount(LocalDateTime time);

    List<TimeCountVo> numberRemaining(LocalDateTime startTime, LocalDateTime endTime);



    void setStatus(Long id);

    List<ReservationVo> getListOfUser(LocalDateTime start, LocalDateTime end);

    void updateStatus(LocalDateTime start, LocalDateTime end);
}
